/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bhatni.mockprocessor.camel;

import com.bhatni.mockprocessor.BaseContext;
import com.bhatni.mockprocessor.BaseMessage;
import com.bhatni.mockprocessor.MockProcessor;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;

/**
 *
 * @author virendra
 */
public class MockCamelProcessor extends MockProcessor implements Processor{

    
    @Override
    public void process(Exchange exchng) throws Exception {
        
       BaseMessage in = new BaseMessage(); 
       in.setBody(exchng.getIn().getBody());
       in.setHeader(exchng.getIn().getHeaders());
       
       BaseContext context = new BaseContext();

       BaseMessage out = new BaseMessage(); 
       
       process(in,out,context);
       
       exchng.getOut().setBody(out.getBody());
       exchng.getOut().setHeaders(out.getHeader());
        
    }
    
    
}
